<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>首页</title>
    <style type="text/css">
        table {border-collapse: collapse; font-size: 14px; width: 80%; margin: auto}
        table, th, td {border: 1px solid darkslategray;padding: 10px}
    </style>
</head>
<body>
<a th:href="@{/etc/insert}">添加</a>
<span>欢迎[[${session.username}]]</span>
<form th:action="@{/etc/findName}" method="post">
    车牌号：<input type="text" name="name"/>
    ETC卡号：<input type="text" name="etcid"/><br/>
    <input type="submit" value="提交">

    <table class="list">
        <tr>
            <th>id</th>
            <th>车牌号</th>
            <th>ETC卡号</th>
            <th>余额</th>
            <th>用户</th>
            <th>使用年限</th>
            <th>操作</th>
        </tr>
        <tr th:each="etc : ${etcList}">
            <td th:text="${etc.id}"></td>
            <td th:text="${etc.name}"></td>
            <td th:text="${etc.etcid}"></td>
            <td th:text="${etc.money}"></td>
            <td th:text="${etc.username}"></td>
            <td th:text="${etc.usebirth}"></td>
            <td><a th:href="@{/etc/findById(id=${etc.getId()})}">修改</a></td>
            <td><a th:href="@{/etc/delete(id=${etc.getId()})}">删除</a></td>
        </tr>
    </table>
</form>
</body>
</html>